<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Brand extends Model
{
    protected $fillable = [
        'name',
        'sort',
        'cover',
        'status'
    ];

    protected $casts = [
        'status' => 'boolean'
    ];

    public function products()
    {
        return $this->hasMany(Product::class);
    }

    // 关联优惠券
    public function couponCodes()
    {
        return $this->morphMany(CouponCode::class, "coupon_codeable");
    }
}
